Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstanceOfPatternMatch: Generic type without parameters #298

Conversation

BoykoAlex
Copy link
Contributor

@BoykoAlex BoykoAlex commented May 30, 2024

@timtebeek timtebeek self-requested a review May 31, 2024 05:54
oldTypeTree.withPrefix(Space.EMPTY),
null,
oldTypeTree.getType()
).withTypeParameters(fqType.getTypeParameters().stream().map(p -> new J.Wildcard(randomId(), Space.EMPTY, Markers.EMPTY, null, null)).collect(Collectors.toList())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self : look at listutils to conform with code elsewhere.

Copy link
Contributor Author

@BoykoAlex BoykoAlex May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ListUtil.map() is for the same type lists, i.e. mapping of List<J> -> List<J> in my case it is List<JavaType> -> List<J>. I felt it is okay... the list can't be long... I only care about its size. If there are 5 type parameters i wanted to produce <?,?,?,?,?>. I can rerwrite this piece to conform to what i mentioned above better rather than have map

@timtebeek
Copy link
Contributor

Thanks a lot for the thorough fix here! I'm still at Spring IO, but will merge this when not reviewing on mobile. :)

@timtebeek timtebeek added the bug Something isn't working label Jun 3, 2024
@timtebeek timtebeek merged commit 889c899 into openrewrite:main Jun 3, 2024
2 checks passed
@timtebeek
Copy link
Contributor

Thanks a lot for the immediate fix @BoykoAlex !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

InstanceOfPatternMatch recipe produces compiler error with generic types without type parameters
2 participants